Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

xml-encryption

Package Overview
Dependencies
Maintainers
49
Versions
37
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

xml-encryption

[![Build Status](https://travis-ci.org/auth0/node-xml-encryption.png)](https://travis-ci.org/auth0/node-xml-encryption)

  • 1.3.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
495K
increased by13.93%
Maintainers
49
Weekly downloads
 
Created

What is xml-encryption?

The xml-encryption npm package provides tools for encrypting and decrypting XML data. It supports various encryption algorithms and allows for the secure handling of XML documents.

What are xml-encryption's main functionalities?

Encrypting XML Data

This feature allows you to encrypt XML data using a specified encryption algorithm and keys. The code sample demonstrates how to encrypt an XML string using RSA and AES256-CBC.

const xmlenc = require('xml-encryption');
const xml = '<root><name>John Doe</name></root>';
const options = { rsa_pub: 'public_key.pem', pem: 'private_key.pem', encryptionAlgorithm: 'http://www.w3.org/2001/04/xmlenc#aes256-cbc' };
xmlenc.encrypt(xml, options, function(err, result) {
  if (err) console.error(err);
  console.log('Encrypted XML:', result);
});

Decrypting XML Data

This feature allows you to decrypt previously encrypted XML data using the appropriate private key. The code sample demonstrates how to decrypt an encrypted XML string.

const xmlenc = require('xml-encryption');
const encryptedXml = '...'; // Encrypted XML string
const options = { key: 'private_key.pem' };
xmlenc.decrypt(encryptedXml, options, function(err, result) {
  if (err) console.error(err);
  console.log('Decrypted XML:', result);
});

Other packages similar to xml-encryption

Keywords

FAQs

Package last updated on 25 Aug 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc